<template>
  <div v-watermark="{ text: '提现审核' }">
        <div style="display:flex;justify-content: center;align-items: center; background:#96B97D ;color: #fff;width: 80px;height: 40px;">{{options.code_ }}</div>
        <el-row>
            <el-col :span="24" style="padding: 20px 10px">
                <el-descriptions  border>
                    <!-- <el-descriptions-item label="id">{{rowobj.application_id}}</el-descriptions-item> -->
                    <!-- <el-descriptions-item label="申请人名称">{{ rowobj.application_name }}</el-descriptions-item> -->
                    <el-descriptions-item label="申请单号">{{ rowobj.application_number }}</el-descriptions-item>
                    <el-descriptions-item label="申请人id">{{ rowobj.application_id }}</el-descriptions-item>
                    <el-descriptions-item label="申请内容">{{ rowobj.application_message }}</el-descriptions-item>
                    <el-descriptions-item label="备注">
                        <el-tag size="small">{{ rowobj.store_id }}</el-tag>
                    </el-descriptions-item>
                    <el-descriptions-item label="状态">{{ rowobj.auditing_status }}</el-descriptions-item>
                    <el-descriptions-item label="省">{{ rowobj.province }}</el-descriptions-item>
                    <el-descriptions-item label="市">{{ rowobj.city }}</el-descriptions-item>
                    <el-descriptions-item label="县">{{ rowobj.district }}</el-descriptions-item>
                </el-descriptions>

            </el-col>
        </el-row>
        <el-row>
     
            <el-col :span="8">
                <div style="display:flex;justify-content: center;align-items: center; background:#96B97D ;color: #fff;width: 80px;height: 40px;">交易图</div>
                    <Kupload ref="myUpload" @callbackFile="callbackFile" typeName="first" />
            </el-col>
            <el-col :span="8">
                {{ application_view }}
            <textarea v-model="application_view" name="审核备注" id="" cols="100%" rows="10"
                placeholder="请輸入审核备注"></textarea>
            </el-col>
        </el-row>
        <el-row type="flex" class="row-bg" justify="end" style="padding: 40px;">

            <el-button type="primary" @click="Auditing(2)">拒绝</el-button>
            <el-button type="primary" @click="Auditing(1)">通过</el-button>
        </el-row>

    </div>
</template>

<script>
import { Auditing_details, withdrawalOpening } from "@/api/Auditing"
import { mapState } from 'vuex'
import Kupload from "@/components/Upload"
export default {
    components: { Kupload },
    data() {
        return {
            activeName: 'first',
            rowobj: null,
            options: {},
            src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
            application_view: ''
        }
    },
    computed: {
        ...mapState('user', { regionalData: "regionalData" })
    },
    methods: {
        callbackFile({ file, typeName, publicWelfareUrl }) {
            console.log(file, 'f')
            this.rowobj.transaction_image = file
        },
        handleClick(activeName) {
            this.activeName = activeName;
        },
        getInfo() {
            Auditing_details({
                application_number: this.options.application_number,
                code_: this.options.code_
            }).then(res => {
                this.rowobj = res.result[0]
            })
        },
        Auditing(operator_code) {
            // application_name: this.rowobj.application_name,
            //     application_id: this.rowobj.application_id,
            //     store_id: this.rowobj.store_id,
            //     store_name: this.rowobj.store_name,
            //     province: this.rowobj.province,
            //     city: this.rowobj.city,
            //     district:  this.rowobj.district,
            //     bak: this.rowobj.bak,
            //     bank_name: this.rowobj.bank_name,
            //     card_number: this.rowobj.card_number,
            //     withdrawal_number: this.rowobj.withdrawal_number
            let res = {
                operator:this.rowobj.operator,
                operator_number:this.rowobj.operator_number,
                application_number: this.rowobj.application_number,
                operator_code:operator_code,
                // application_view:this.rowobj.application_view,
                transaction_image:this.rowobj.transaction_image
            }
            var formData = new FormData();
            for (let i in res) {
                formData.append(i, res[i])
            }
            withdrawalOpening(formData).then(res => {
                if(res.data.code == 16){
                     this.$message({
                    message: res.data.string,
                    type: 'success'
                });
                }else{
                    this.$message({
                    message: res.data.string,
                    type: 'error'
                });
                }
               
            })
        }
    },
    mounted() {

        this.options = this.$route.query;
        console.log(this.options, 'red')
        this.getInfo()
    }
}
</script>

<style></style>